if cell is set, always pass in path to gtk_tree_view_get_cell_area()
authorKristian Rietveld <kris@imendio.com>
Thu, 13 Sep 2007 14:15:40 +0000 (14:15 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Thu, 13 Sep 2007 14:15:40 +0000 (14:15 +0000)
2007-09-13  Kristian Rietveld  <kris@imendio.com>

* gtk/gtktreeview.c (gtk_tree_view_set_toooltip_cell): if cell
is set, always pass in path to gtk_tree_view_get_cell_area() whether
it is NULL or set.  Added explanatory comment and added this
side case to the API documentation.

svn path=/trunk/; revision=18812

ChangeLog
gtk/gtktreeview.c

index 0b401d0797b7cb338006d38beb473408320c43ed..f1e9c9183400483d1e30aa4faec907e0c2bc4877 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-13  Kristian Rietveld  <kris@imendio.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_set_toooltip_cell): if cell
+       is set, always pass in path to gtk_tree_view_get_cell_area() whether
+       it is NULL or set.  Added explanatory comment and added this
+       side case to the API documentation.
+
 2007-09-12  Emmanuele Bassi  <ebassi@gnome.org>
 
        * gtk/gtkfilechooserdefault.c (render_recent_icon): Use the
index e36af7d64141912893ab2ebedc68b03321eb80c8..5de6080e48facc3a68de0e45153a2dbd3a548db0 100644 (file)
@@ -15383,6 +15383,11 @@ gtk_tree_view_set_tooltip_row (GtkTreeView *tree_view,
  * area will be set to the full area covered by @column.  See also
  * gtk_tooltip_set_tip_area().
  *
+ * Note that if @path is not specified and @cell is set and part of a column
+ * containing the expander, the tooltip might not show and hide at the correct
+ * position.  In such cases @path must be set to the current node under the
+ * mouse cursor for this function to operate correctly.
+ *
  * Since: 2.12
  */
 void
@@ -15409,11 +15414,16 @@ gtk_tree_view_set_tooltip_cell (GtkTreeView       *tree_view,
       GdkRectangle tmp;
       gint start, width;
 
-      gtk_tree_view_get_cell_area (tree_view, NULL, column, &tmp);
+      /* We always pass in path here, whether it is NULL or not.
+       * For cells in expander columns path must be specified so that
+       * we can correctly account for the indentation.  This also means
+       * that the tooltip is constrained vertically by the "Determine y
+       * values" code below; this is not a real problem since cells actually
+       * don't stretch vertically in constrast to columns.
+       */
+      gtk_tree_view_get_cell_area (tree_view, path, column, &tmp);
       gtk_tree_view_column_cell_get_position (column, cell, &start, &width);
 
-      /* FIXME: a need a path here to correctly correct for indent */
-
       gtk_tree_view_convert_bin_window_to_widget_coords (tree_view,
                                                         tmp.x + start, 0,
                                                         &rect.x, NULL);